<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Callback function when there is a data packet for a task (deprecated)</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="gearmanclient.runtasks.html">GearmanClient::runTasks</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="gearmanclient.setcompletecallback.html">GearmanClient::setCompleteCallback</a></div>
 <div class="up"><a href="class.gearmanclient.html">GearmanClient</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="gearmanclient.setclientcallback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">GearmanClient::setClientCallback</h1>
  <p class="verinfo">(PECL gearman &lt;= 0.5.0)</p><p class="refpurpose"><span class="refname">GearmanClient::setClientCallback</span> &mdash; <span class="dc-title">Callback function when there is a data packet for a task (deprecated)</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-gearmanclient.setclientcallback-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>GearmanClient::setClientCallback</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>
   )</div>

  <p class="para rdfs-comment">
   Sets the callback function for accepting data packets for a task. The callback function should
   take a single argument, a <a href="class.gearmantask.html" class="classname">GearmanTask</a> object.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    This method has been replaced by <span class="methodname"><a href="gearmanclient.setdatacallback.html" class="methodname">GearmanClient::setDataCallback()</a></span> in
    the 0.6.0 release of the Gearman extension.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-gearmanclient.setclientcallback-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">callback</code></em></dt>

     <dd>

      <p class="para">
       A function or method to call
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-gearmanclient.setclientcallback-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-gearmanclient.setclientcallback-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="gearmanclient.setcompletecallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setCompleteCallback()</a> - Set a function to be called on task completion</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setcreatedcallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setCreatedCallback()</a> - Set a callback for when a task is queued</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setdatacallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setDataCallback()</a> - Callback function when there is a data packet for a task</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setexceptioncallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setExceptionCallback()</a> - Set a callback for worker exceptions</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setfailcallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setFailCallback()</a> - Set callback for job failure</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setstatuscallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setStatusCallback()</a> - Set a callback for collecting task status</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setwarningcallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setWarningCallback()</a> - Set a callback for worker warnings</span></li>
    <li class="member"><span class="methodname"><a href="gearmanclient.setworkloadcallback.html" class="methodname" rel="rdfs-seeAlso">GearmanClient::setWorkloadCallback()</a> - Set a callback for accepting incremental data updates</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="gearmanclient.runtasks.html">GearmanClient::runTasks</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="gearmanclient.setcompletecallback.html">GearmanClient::setCompleteCallback</a></div>
 <div class="up"><a href="class.gearmanclient.html">GearmanClient</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
